﻿using System;
using System.Data;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Model;
using Function;

namespace UI.Module.InvestmentIncome
{
    public partial class Storebuilding : System.Web.UI.Page
    {
        protected List<st_buidingmsg> list = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //投资者下的门店列表信息
                StringBuilder sb = new StringBuilder();
                DataSet shopList = new ST_ShopBLL().GetShopList(Method.CurrentUserID);
                DataSet shopListUserName = new ST_ShopBLL().GetShopListNum(Method.CurrentUserID);
                if (shopList == null || shopListUserName==null)
                {
                    MessageBox_Page McBx = new MessageBox_Page();//实例化对话框
                    string RemarkString;
                    RemarkString = "未找到对象";

                    McBx.Title = "系统提示";
                    McBx.AddContent(RemarkString);
                    McBx.Type = MsgType.Error;
                    McBx.AddUrl("返回", "../../Module/User/UserMsge.aspx", UrlType.Href);
                    MessageEvent.MessageBox(McBx, "../../ErrorPage/ShowMsg.aspx");
                    return;
                }
                list = new List<st_buidingmsg>();
                foreach (DataRow item in shopListUserName.Tables[0].Rows)
                {
                    st_buidingmsg model = new st_buidingmsg();
                    model.ShopID = item["ShopID"].ToInt32();
                    model.UserNum = item["userNum"].ToInt32();
                    foreach (DataRow item1 in shopList.Tables[0].Rows)
                    {
                        if (item1["ShopID"].ToString()==item["ShopID"].ToString())
                        {
                            model.Name += item1["TrueName"].ToString()+",";
                            model.Tel += item1["MobilePhone"].ToString() + ",";
                            model.Address = item1["Address"].ToString();
                            model.ShopName = item1["shopName"].ToString();
                        }
                    }
                    list.Add(model);
                }
            }
        }
    }
    public class st_buidingmsg
    {
        private int shopID;

        public int ShopID
        {
            get { return shopID; }
            set { shopID = value; }
        }
        private int userNum;

        public int UserNum
        {
            get { return userNum; }
            set { userNum = value; }
        }
        private string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        private string tel;

        public string Tel
        {
            get { return tel; }
            set { tel = value; }
        }
        private string shopName;

        public string ShopName
        {
            get { return shopName; }
            set { shopName = value; }
        }

        private string address;

        public string Address
        {
            get { return address; }
            set { address = value; }
        }
    }
}